
import 'package:flutter/material.dart';

import 'dart:async';
import 'package:flutter/material.dart';
// ignore: must_be_immutable
class MyDialog extends Dialog {
  String title;
  String content;
  Function()? onClosed;
  MyDialog({Key? key, required this.title,required
  this.onClosed,this.content=""}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Material(
        type: MaterialType.transparency,
        child: Center(
        child: Container(
        height: 300,
        width: 300,
        color: Colors.white,
        child: Column(
        children: <Widget>[
        Padding(
          padding: const EdgeInsets.all(10),
          child: Stack(
            children: <Widget>[
              Align(
                alignment: Alignment.center,
                child: Text(title),
              ),
              Align(
                alignment: Alignment.centerRight,
                child: InkWell(
                  onTap: onClosed,
                  child: const Icon(Icons.close),
                ),
              )
            ],
          ),
        ),
          const Divider(),
          Container(
            padding: const EdgeInsets.all(10),
            width: double.infinity,
            child: Text(content,textAlign: TextAlign.left),
          )
        ],
        ),
        )),
    );
  }
}